package method;
//计算圆锥体积
//
//计算圆柱体体积
//
//计算正方体体积
public class Demo05 {
    public static void main(String[] args) {
        double a=Math.PI;
        System.out.println(a);
        int r=2;
        int h=3;
        // double cone=r*r*a+ (double) 1 /3;
        // double cylinder=r*r*a*h;
        System.out.println("圆锥体积为："+a*pow(r,2)*h*1/3);
        System.out.println("圆柱体积为："+a*pow(r,2)*h);
        int c=3;
        System.out.println("正方体体积为："+pow(c,3));
    }
    public static double pow(double c, double d){
        return Math.pow(c, d);
    }
}
